<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 巡检信息数据表
 *
 * Date: 19/03/2018
 * @author George
 */
class CreateInspectionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('inspections', function (Blueprint $table) {
            $table->increments('id');
			$table->unsignedInteger('company_id')->index()->comment('公司ID');
			$table->unsignedInteger('project_id')->index()->comment('项目ID');
			$table->unsignedInteger('line_id')->index()->comment('线路ID');
			$table->unsignedInteger('circle_id')->index()->comment('点位ID');
			$table->unsignedInteger('node_id')->index()->comment('点位ID');
			$table->unsignedInteger('user_id')->index()->comment('人员ID');
			$table->string('user_name')->comment('报岗人员姓名');
			$table->string('node_name')->comment('报岗人员姓名');
			$table->decimal('longitude', 10, 7)->comment('经度');
			$table->decimal('latitude', 10, 7)->comment('纬度');
			$table->string('location')->comment('位置');
			$table->string('example')->comment('示例图片ID');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('inspections');
    }
}
